package com.anolesoft.yr.mbus.prod.base.mapper;

import com.anolesoft.yr.mbus.prod.base.dto.ProdBaseServiceDeleteDTO;
import com.anolesoft.yr.mbus.prod.base.dto.ProdBaseServiceValueDeleteDTO;
import com.anolesoft.yr.mbus.prod.base.dto.ProdBaseServiceValueSaveDTO;
import com.anolesoft.yr.mbus.prod.base.dto.ProdBaseServiceValueUpdateDTO;
import com.anolesoft.yr.mbus.prod.base.sql.ProdBaseServiceValueSQL;
import com.anolesoft.yr.mbus.prod.base.vo.ProdBaseServiceValueQueryVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProdBaseServiceValueMapper {

    //新增服务项参数基础信息表
    @Insert(ProdBaseServiceValueSQL.SAVE_PROD_BASE_SERVICE_VALUE)
    int saveProdBaseServiceValue(ProdBaseServiceValueSaveDTO prodBaseServiceValueSaveDTO);

    //根据主键查询服务项参数基础唯一数据
    @Select(ProdBaseServiceValueSQL.QUERY_PROD_BASE_SERVICE_VALUE_BY_UID)
    @Results(id = "queryProdBaseServiceValueByUid", value = {
            @Result(column = "objuid", property = "objuid"),
            @Result(column = "value", property = "updateValue"),
            @Result(column = "is_default", property = "updateIsDefault"),
            @Result(column = "is_holiday", property = "updateIsHoliday"),
            @Result(column = "accept_time", property = "updateAcceptTime"),
            @Result(column = "reply_time", property = "updateReplyTime"),
            @Result(column = "delivery_time", property = "updateDeliveryTime"),
            @Result(column = "arrival_time", property = "updateArrivalTime"),
            @Result(column = "remark", property = "updateRemark")
    })
    List<ProdBaseServiceValueQueryVO> queryProdBaseServiceValueByUid(String uid);

    //根据主键查询服务项参数基础唯一数据
    @Select(ProdBaseServiceValueSQL.QUERY_PROD_BASE_SERVICE_VALUE_BY_UID2)
    @Results(id = "queryProdBaseServiceValueByUid2", value = {
            @Result(column = "objuid", property = "objuid"),
            @Result(column = "value", property = "updateValue"),
            @Result(column = "is_default", property = "updateIsDefault"),
            @Result(column = "is_holiday", property = "updateIsHoliday"),
            @Result(column = "accept_time", property = "updateAcceptTime"),
            @Result(column = "reply_time", property = "updateReplyTime"),
            @Result(column = "delivery_time", property = "updateDeliveryTime"),
            @Result(column = "arrival_time", property = "updateArrivalTime"),
            @Result(column = "remark", property = "updateRemark")
    })
    List<ProdBaseServiceValueQueryVO> queryProdBaseServiceValueByUid2(String uid);

    //修改服务项参数基础信息表
    @Update(ProdBaseServiceValueSQL.UPDATE_PROD_BASE_SERVICE_VALUE)
    int updateProdBaseServiceValue(ProdBaseServiceValueUpdateDTO prodBaseServiceValueUpdateDTO);

    //删除服务项参数基础信息表
    @Update(ProdBaseServiceValueSQL.DELETE_PROD_BASE_SERVICE_VALUE)
    int deleteProdBaseServiceValue(String objuid);

    //删除服务项参数基础信息表
    @Update(ProdBaseServiceValueSQL.DELETE_PROD_BASE_SERVICE_VALUE2)
    int deleteProdBaseServiceValue2(@Param("prodBaseServiceUid") String prodBaseServiceUid, @Param( "prodBaseServiceValueDeleteDTOList" ) List<ProdBaseServiceValueDeleteDTO>  prodBaseServiceValueDeleteDTOList);

}
